import Vue from "vue" 
import Home from "../pages/Home.vue"
import News from "../pages/News.vue"
import Layout from "../pages/Layout.vue"
import Login from "../pages/Login.vue"
import VueRouter from "vue-router"
import Music from "../components/Music.vue"
Vue.use(VueRouter)
const routes=[
 
    {
    path:"/music",
    component:()=>import("../components/Music.vue"),
},
// {
//     path:"/login",
//     component:()=>import("../pages/Login.vue"),
// },
// {
//     path:"/News",
//     component:News
// 
// {
//     path:"/",
//     component:Layout,
//     children:[{
//         path:"/home",
//         component:Home
//         },
//         {
//             path:"news",
//             name:"news",
//             component:()=>import("../pages/News.vue"),
//             // redirect:"/news/today",
//         children:[{
//             path:"today/:idd",
//             component:()=>import("../pages/Today.vue"),
//             props:true
//         },
//         {
//             path:"yesterday/:id",
//             component:()=>import("../pages/Yesterday.vue")
//         }
//         ]
//         }
//     ]
//     },    
// {
//     path:"/news",
//     name:"news",
//     component:()=>import("../pages/News.vue"),
//     // redirect:"/news/today",
// children:[{
//     path:"today/:idd",
//     component:()=>import("../pages/Today.vue"),
//     props:true
// },
// {
//     path:"yesterday/:id",
//     component:()=>import("../pages/Yesterday.vue")
// }
// ]
// }
]
const router=new VueRouter({
    mode:"history",
    // routes:routes
    routes,
})
// router.beforeEach((to,from,next)=>{
//     let user=null;
//         if(to.path=="/"){
//             if(user){
//                 next()
//             }else{
//                 next('/login')
//         }
//         }else{
//             next();
//         }
// })

export default router